const { getOrder, getOrderSearch, delOrder ,checkOrder} = require('../../dao/order/orderDao')
module.exports.getOrder = async params => {
    if (params.selectType) {
        if (params.selectType == "all") {
            return await getOrder(params)
        } else {
            return await getOrderSearch(params)
        }
    } else if (params.pageNum) {
        return await getOrder(params)
    }

}

//根据_id删除订单
module.exports.delOrder = async function (_id) {
    const data = await delOrder(_id)
    if(data.length>=1){
        return data.length
    }else{
        return data
    }
}

//根据_id修改订单
module.exports.checkOrder = async function (_id) {
    const data = await checkOrder(_id)
    return data
}